function selectBox(){
	
  var checkboxis = document.getElementsByName("id");
 
  for (var i=0; i<checkboxis.length; i++){
	
    //alert(checkboxis[i].checked);          
    if(document.all.note.checkid.checked == true){
    
      checkboxis[i].checked = true;
    }else{
      checkboxis[i].checked = false;
       
    }     
  }
}
//all pass
function selectBox1(){
	 
  var checkboxis1 = document.getElementsByName("id1");
  var checkboxis2 = document.getElementsByName("id2");
  var hidden = document.getElementsByName("hi7");
 // document.all.check.count.value = "0";
 // document.all.check.sum.value = "0.00";
 
  for (var i=0; i<checkboxis1.length; i++){
	
    //alert(checkboxis[i].checked);          
    if(document.all.check.checkid1.checked == true){
    	 
      document.all.check.checkid2.checked = false;
	  document.all.check.count.value++;
	  document.all.check.sum.value = (parseFloat(document.all.check.sum.value) + parseFloat(hidden[i].value)).toFixed(2);
      checkboxis1[i].checked = true;
      checkboxis2[i].checked = false;
      checkboxis1[i].disabled = false;
      checkboxis2[i].disabled = true;
    }else{
    	
      checkboxis1[i].checked = false;
      checkboxis2[i].disabled = false;
      checkboxis1[i].disabled = false;
      if(checkboxis1[i].checked){
        document.all.check.count.value--;
        document.all.check.sum.value = (parseFloat(document.all.check.sum.value) - parseFloat(hidden[i].value)).toFixed(2);
      }
    }     
   
  }
}
// all not pass
function selectBox2(){
  var checkboxis1 = document.getElementsByName("id1");
  var checkboxis2 = document.getElementsByName("id2");
  for (var i=0; i<checkboxis2.length; i++){
    //alert(checkboxis[i].checked);          
    if(document.all.check.checkid2.checked == true){
      document.all.check.checkid1.checked = false;
      checkboxis2[i].checked = true;
      checkboxis1[i].checked = false;
      checkboxis2[i].disabled = false;
      checkboxis1[i].disabled = true;
      document.all.check.count.value = "0";
      document.all.check.sum.value = "0.00";
    }else{
      checkboxis2[i].checked = false;
      checkboxis2[i].disabled = false;
      checkboxis1[i].disabled = false;
    }     
  }
}
//pass
function id1_click(val){
  var checkboxis1 = document.getElementsByName("id1");
  var checkboxis2 = document.getElementsByName("id2");
  var hidden = document.getElementsByName("hi7");
  for (var i=0; i<checkboxis1.length; i++){
    if(checkboxis1[i].value == val){
      if(checkboxis1[i].checked){
     	document.all.count.value++;
        document.all.sum.value = (parseFloat(document.all.sum.value) + parseFloat(hidden[i].value)).toFixed(2);
        if(checkboxis2[i].checked) {
          checkboxis2[i].checked = false;
        }else{
          checkboxis1[i].disabled = false;
        }
        checkboxis2[i].disabled = true;
      }else{
     	document.all.count.value--;
        document.all.sum.value = (parseFloat(document.all.sum.value) - parseFloat(hidden[i].value)).toFixed(2);
        checkboxis2[i].disabled = false;
        checkboxis1[i].disabled = false;
      }
    }
  }
}
//not pass
function id2_click(val){
  var checkboxis1 = document.getElementsByName("id1");
  var checkboxis2 = document.getElementsByName("id2");
  var hidden = document.getElementsByName("hi7");
  for (var i=0; i<checkboxis2.length; i++){
    if(checkboxis2[i].value == val){
      if(checkboxis2[i].checked){
        if(checkboxis1[i].checked) {
     	  document.all.check.count.value--;
          document.all.check.sum.value = (parseFloat(document.all.check.sum.value) - parseFloat(hidden[i].value)).toFixed(2);
          checkboxis1[i].checked = false;
        }else{
          checkboxis2[i].disabled = false;
        }
        checkboxis1[i].disabled = true;
      }else{
        checkboxis2[i].disabled = false;
        checkboxis1[i].disabled = false;
      }
    }
  }
}
function bsearch(){
    document.all.check.action = 'bcheck.do?method=initFind';
    document.all.check.submit();
}
function psearch(){
    document.all.check.action = 'pcheck.do?method=initFind';
    document.all.check.submit();
}
function btn_onclick() {
  var temp= window.showModalDialog("html/fun.html","","center=yes;dialogHeight:10;dialogWidth:18;help=no;status=no");
  if(temp!=null){
    document.getElementById("str").value = temp;
    document.all.check.submit();
  }
}
function submit_yes(){
  var temp= window.showModalDialog("html/fun.html","","center=yes;dialogHeight:10;dialogWidth:18;help=no;status=no");
  if(temp!=null){
    document.getElementById("str").value = temp;
    document.all.note.action='bcheck.do?method=process2_yes';
    document.all.note.submit();
  }
}
function submit_deny(){
  var temp= window.showModalDialog("html/fun.html","","center=yes;dialogHeight:10;dialogWidth:18;help=no;status=no");
  if(temp!=null){
    document.getElementById("str").value = temp;
    document.all.note.action='bcheck.do?method=process2_deny';
    document.all.note.submit();
  }
}
function submit_batch(){
  var temp= window.showModalDialog("html/fun.html","","center=yes;dialogHeight:10;dialogWidth:18;help=no;status=no");
  if(temp!=null){
    document.getElementById("str").value = temp;
   
    document.all.check.action='bbpay.do?method=processBatch';
    document.all.check.submit();
  }
}

function Foreign_batch(){
	  var temp= window.showModalDialog("html/fun.html","","center=yes;dialogHeight:10;dialogWidth:18;help=no;status=no");
	  if(temp!=null){
	    document.getElementById("str").value = temp;
	   
	    document.all.check.action='bbpay.do?method=foreignBatch';
	    document.all.check.submit();
	  }
	}